home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
wpjv1n2.zip
/
HAXTON.ZIP
/
TESTLIB.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-28
|
2KB
|
95 lines
//************************************************************************
//*
//* testlib.c
//*
//************************************************************************
#define NOCOMM
#define _WINDOWS
#define _WINDLL
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "dlls.h"
int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize,
LPSTR lpszCmdLine)
{
if(wHeapSize != 0)
UnlockData(0);
return(1);
} /* LibMain */
//*************************************************************************>
int FAR PASCAL WEP(int doNothing)
{
return(1);
} /* WEP */
//*************************************************************************>
BOOL FAR PASCAL StepOne(HWND hWnd)
{
/* local variables */
static char string[20], string2[20];
short num1, num2;
MessageBox(hWnd, "In StepOne routine!", "StepOne", MB_OK);
num1= 10;
num2= 20;
/* demonstrates how to pass these variables as far pointers */
/* if not passed as far pointers, you get bogus data */
testVars(hWnd, (short far *) &num1, ( short far *) &num2);
/* demonstrates Standard C routines inside a DLL */
/* notice the variables have been declared static */
/* thus, they are in the DLLs DS */
itoa(num1, string, 10);
strcpy(string2, "num1= ");
strcat(string2, string);
MessageBox(hWnd, string, "StepOne", MB_OK);
return(TRUE);
} /* StepOne */
//*************************************************************************>
BOOL FAR PASCAL StepTwo(HWND hWnd)
{
/* local variables */
char testStr2[20];
static char testStr[30];
static short num1, num2;
strcpy(testStr, "In StepTwo routine!");
MessageBox(hWnd, testStr, "StepTwo", MB_OK);
testStr2[0]= 'T';
testStr2[1]= 'e';
testStr2[2]= 's';
testStr2[3]= 't';
testStr2[4]= '\0';
testRoutine(hWnd, (char far *) testStr2);
num1= 20;
num2= 30;
testVars(hWnd, (short far *) &num1, ( short far *) &num2);
return(TRUE);
} /* StepTwo */